package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.Tablelnject;
import com.sky.dto.SetmealDTO;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealMapper {

    /**
     * 根据分类id查询套餐的数量
     * @param id
     * @return
     */
    Integer countByCategoryId(Long id);

    /**
     * 新增套餐
     */
    @Tablelnject(OperationType.INSERT)
    void save(Setmeal setmeal);

    /**
     * 根据id查询套餐
     */
    Setmeal setmealById(Long id);

    Page<Setmeal> page(SetmealPageQueryDTO setmealPageQueryDTO);
    @Tablelnject(OperationType.UPDATE)
    void upDate(Integer status, Long id);

    void delSetmeal(List<Long> ids);

    void upSetmeal(Setmeal setmeal);

    List<Setmeal> setmealDishById(SetmealDish setmealDish);

    void upStatus(Long setmealId,Integer status);

    List<Setmeal> list(SetmealDTO setmealDTO);
}
